package hl.demo;

import java.util.*;

public class ScannerTest {


    public static void main(String args[]){

        Scanner scan = new Scanner(System.in);

        String[] arg = new String[3];
        System.out.println("输入三个命令(按行书写)：");
        for (int i = 0; i < 3; i++) {
            if (scan.hasNextLine())
            arg[i] = scan.nextLine();
        }

        for (int i = 0; i < 3; i++){
            System.out.println(arg[i]);
        }
/*
        System.out.print("请输入数字：");
        if (scan.hasNextInt()){
            int num = scan.nextInt();
            System.out.println(num);
        }

        System.out.print("请输入字符串：");
        String str = scan.next();
        System.out.println(str);

        System.out.print("请输入小数：");
        double dou = scan.nextDouble();
        System.out.println(dou);
*/

        scan.close();
    }
}
